﻿@{ Layout = "../../Views/Shared/_LayoutPhone.cshtml";}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<div class="container-fluid bg-light-opac">
    <script>
        $(document).ready(function () {
            $("#geren1").attr("hidden", "");
            $("#geren2").removeAttr("hidden", "");
            $("#geren3").attr("hidden", "");
            $("#geren4").removeAttr("hidden", "");

            $(function () {
                var isPageHide = false;
                window.addEventListener('pageshow', function () {
                    if (isPageHide) {
                        window.location.href = "../PhoneGeRen/GeRenXinXi";
                    }
                });
                window.addEventListener('pagehide', function () {
                    isPageHide = true;
                });
            })
        })
    </script>
    <div class="row">
        <div class="container my-3 main-container">
            <div class="row align-items-center">
                <div class="col">
                    <h2 class="content-color-primary page-title" id="XingMing">姓名：@ViewData["mingcheng"]</h2>
                    <p class="content-color-secondary page-sub-title" id="ZhangHao">账号：@ViewData["zhanghao"]</p>
                </div>
                <div class="avatar avatar-70 mx-auto my-0">
                    @*<img src="~/GoTRI/img/user1.png" alt="" />*@
                    <div id="div_nan"><img src='~/GoTRI/img/男.jpg' alt=''></div>
                    <div id="div_nv"><img src='~/GoTRI/img/女.jpg' alt=''></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- content page title ends -->
<!-- content page -->
<div class="container mt-4 main-container">
    <div class="row">

        <div class="col-12 col-md-4 order-1 order-md-2">
            <div class="card mb-4">
                <div class="card-body p-0">
                    <table class="table mb-0">
                        <tbody>
                            <tr onclick="wodekehu()">
                                <td>我的客户</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <tr onclick="wodehuibao()">
                                <td>我的汇报</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <tr onclick="xuegaimima()">
                                <td>修改密码</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <tr onclick="genjinjilu()">
                                <td>跟进记录</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <tr onclick="huibao()">
                                <td>汇报记录</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <tr id="pan" onclick="daofang()">
                                <td>到访记录</td>
                                <td class="text-right"><img src='/GoTRI/img/right.png' style="width:18px;height:28px" /></td>
                            </tr>
                            <!--<tr class="font-weight-bold">-->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-bottom: 50px;padding-bottom:1px"></div>
<span id="panduan" hidden="hidden">@ViewData["panduan"]</span>
<script>
    $(document).ready(function () {
        //touxiang();
        huiju();
        var panduan = $("#panduan").text();
        if (panduan == "置业顾问") {
            $("#pan").removeAttr("hidden", "");
        } else {
            $("#pan").attr("hidden", "");
        }
    });
    function huiju() {
        $.ajax({
            type: "POST",
            url: "../PhoneGeRen/huiju",
            cache: false,  //禁用缓存
            data: {},  //传入组装的参数
            dataType: "json",
            success: function (result) {
                var json = result;
                //$.each(json, function (index) {
                //    $("#XingMing").text("名称:" + json[index].XingMing);
                //    $("#ZhangHao").text("账号:" + json[index].ZhangHao);
                //})
                if (json.length > 0) {
                    if (json[0].XingBie == "男") {
                        $("#div_nan").show();
                        $("#div_nv").hide();
                    } else {
                        $("#div_nan").hide();
                        $("#div_nv").show();
                    }
                }
            }
        });
    }
    //function touxiang() {
    //    $.ajax({
    //        type: "POST",
    //        url: "../PhoneGeRen/touxiang",
    //        cache: false,  //禁用缓存
    //        data: {},  //传入组装的参数
    //        dataType: "text",
    //        success: function (result) {
    //            //alert(result);
    //            if (result == "男") {
    //                $("#div_nan").show();
    //                $("#div_nv").hide();
    //            } else {
    //                $("#div_nan").hide();
    //                $("#div_nv").show();
    //            }
    //        }
    //    });
    //}
    function wodekehu() {
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../PhoneKeHu/My_Customer?panduan=geren"; /*WoDeKeHu*/
    }
    function wodehuibao() {
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../PhoneHuiBao/BenRenHuiBaoList";
    }
    function genjinjilu() {
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../PhoneKeHu/GenJinJiLuToday";
    }
    function huibao() {
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../PhoneHuiBao/HuiBaoList";
    }
    function daofang() {
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../PhoneTongJi/ZYDaoFangJiLu";
    }
    function xuegaimima() { 
        setTimeout(function () { $("#nb").removeAttr("hidden", "") }, 2000); window.location.href = "../RenYuan/PhoneMiMaXueGai";
    }
</script>
